package com.xxl.job.executor.protocol;

import com.xxl.job.core.log.XxlJobLogger;

import java.io.IOException;
import java.net.InetAddress;

public class PingProtocol {

    public static boolean ping(String ipAddress) {
        int  timeOut =  3000 ;
        boolean status=false;
        try {
            status = InetAddress.getByName(ipAddress).isReachable(timeOut);
        } catch (IOException e) {
            e.printStackTrace();
            XxlJobLogger.log("IP地址不可用："+ipAddress);
        }
        return status;
    }
}
